<!-- MAIN CONTENT -->

<div id="content">   
    <div smart-include="sensor/views/sub-header.tpl.html"></div>
        <div class="clearfix">
            <div class="pull-left">
                <strong class="font-md">账号：</strong>
                <label class="input">
                    <input type="text" class="lineHeight" style="vertical-align: middle" ng-model="paginationConf.submit_user">
                </label>
            </div>
            <div class="pull-left">
                <strong class="font-md">时间范围：</strong>
                <label class="input">
                    <input type="text" class="lineHeight" name="startdate" id="startdate" placeholder="开始日期：" ng-model="paginationConf.timefrom">
                    <i class="icon-append fa fa-calendar"></i>
                </label>
                -
                <label class="input">
                    <input type="text" class="lineHeight" name="finishdate" id="finishdate" placeholder="结束日期：" ng-model="paginationConf.timeto">
                    <i class="icon-append fa fa-calendar"></i>
                </label>
                <a class="btn btn-primary" href-void="" ng-click="sends()">查询</a>
            </div>
        </div>
        <div id="exportable" class="table-responsive">
            <table class="table table-bordered table-hover no-margin font-sml table-striped sensor_table">
                <thead>
                    <tr>
                        <!-- <th class="text-align-center">操作</th> -->
                        <th class="text-align-center">图片</th>
                        <th class="text-align-center">项目</th>
                        <th class="text-align-center">账号</th>
                        <th class="text-align-center">标题</th>
                        <th class="text-align-center">内容</th>
                        <th class="text-align-center">时间</th>    
                        <th class="text-align-center">状态</th>
                    </tr>
                </thead>
                <tbody>
                    <tr ng-repeat="data in datas">
                        <!-- <td>
                          <button class='btn btn-xs btn-default' uib-tooltip='审批' tooltip-append-to-body='true' ng-click="show_chuli(data.id,data.statue)"  ng-disabled="observer"><i class='fa fa-pencil'></i>处理</button>
                          <button class='btn btn-xs btn-default' uib-tooltip='删除' tooltip-append-to-body='true' ng-click="showDelDialog(data.id)" ng-disabled="observer"><i class='fa fa-times'></i></button>
                        </td> -->
                        <td class="text-align-center">
                            <img class="imgborder" ng-src="{{data.file_url}}" alt="无图" ng-click="show_image(data.file_url)" />
                        </td>
                        <td class="text-align-center">{{data.proname}}</td>
                        <td class="text-align-center">{{data.submit_user}}</td>
                        <td class="text-align-center">{{data.title}}</td>
                        <td class="text-align-center">{{data.content}}</td>
                        <td class="text-align-center">{{data.time}}</td>  
                        <td class="text-align-center" style="color: {{data.col}};">{{data.statue}}</td>
                    </tr>

                </tbody>
            </table>
        </div>
        <!-- end widget content -->
        <div class="dt-toolbar-footer">
            <tm-pagination conf="paginationConf"></tm-pagination>
        </div>
        <!-- <div class="clearfix" style="background:#fafafa">
            <button class="btn btn-primary glyphicon glyphicon-export pull-right" ng-click="exportData()"> 导出</button>
        </div> -->
        <!-- 添加弹框 -->
        <div class="modal fade" id="addAlert" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                        &times;
                    </button>
                    <h4 class="modal-title" id="myModalLabel">添加</h4>
                </div>
                <div class="modal-body">
                    <form  class="form-horizontal multipart/form-data">
                        <div class="form-group">
                            <label class="col-sm-2 control-label">项目</label>
                            <div class="col-sm-9">
                              <select class="form-control" ng-model="addobj.projectid">
                                <option ng-repeat="list in projects" value="{{list.id}}">{{list.name}}</option>
                            </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">标题</label>
                            <div class="col-sm-9">
                              <input type="text"  ng-model="addobj.title" class="form-control" placeholder="标题">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">内容</label>
                            <div class="col-sm-9">
                              <textarea class="form-control" ng-model="addobj.content" rows="3" placeholder="内容"></textarea>                             
                            </div>
                        </div>
                        <div class="form-group">
                           <label class="col-sm-2 control-label">文件</label>
                           <div class="col-sm-9">
                               <input id="file-photo" name="file" type="file" class="form-control" multiple data-overwrite-initial="false" data-min-file-count="1">
                           </div>                                                
                        </div>
                    </form>
                    <div class="modal-footer">
                        <button class="btn btn-default"data-dismiss="modal">关闭</button>
                        <button class="btn btn-primary" ng-click="sure_add()">提交</button>
                    </div>
                </div>
            </div> <!-- modal-content -->
          </div>
          </div>
          <!-- del -->
          <!-- del -->
        <div class="modal fade" id="del_box" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                        ×
                    </button>
                    <h4 class="modal-title">信息</h4>
                </div>
                <div class="modal-body">
                    <p>
                        您确实要删除这个日志吗？
                    </p>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">
                        关闭
                    </button>
                    <button type="button" class="btn btn-primary" ng-click="sure_del()">
                        删除
                    </button>
                </div>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
    <!-- chuli -->
    <div class="modal fade" id="chuli_box" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                        ×
                    </button>
                    <h4 class="modal-title">信息</h4>
                </div>
                <div class="modal-body">
                    <p>
                        您确实要修改这个日志状态吗？
                    </p>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">
                        关闭
                    </button>
                    <button type="button" class="btn btn-primary" ng-click="sure_agree()">
                        通过
                    </button>
                    <button type="button" class="btn btn-primary" ng-click="sure_disagree()">
                        不通过
                    </button>
                </div>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
    <!-- image show start -->
    <div class="modal fade text-center" id="image_box" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="read_imgs_90">
            <i class="glyphicon glyphicon-repeat"></i>
        </div>
          <img ng-src="{{show_imageurl}}" style="position: relative;top: 10%; max-width: 90%"/>
    </div>
  <!-- image show end -->
</div>
<!-- END MAIN CONTENT -->
    <script>


    var pagefunction = function () {



        // START AND FINISH DATE
        $('#startdate').datepicker({
            //dateFormat : 'dd.mm.yy',
            dateFormat: 'yy.mm.dd',
            prevText: '<i class="fa fa-chevron-left"></i>',
            nextText: '<i class="fa fa-chevron-right"></i>',
            monthNames: ['一月','二月','三月','四月','五月','六月','七月','八月','九月','十月','十一月','十二月'],  
            dayNames: ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'],  
            dayNamesShort: ['周日','周一','周二','周三','周四','周五','周六'],  
            dayNamesMin: ['日','一','二','三','四','五','六'],
            onSelect: function (selectedDate) {
                $('#finishdate').datepicker('option', 'minDate', selectedDate);
            }
        });

        $('#finishdate').datepicker({
            dateFormat: 'yy.mm.dd',
            prevText: '<i class="fa fa-chevron-left"></i>',
            nextText: '<i class="fa fa-chevron-right"></i>',
            monthNames: ['一月','二月','三月','四月','五月','六月','七月','八月','九月','十月','十一月','十二月'],  
            dayNames: ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'],  
            dayNamesShort: ['周日','周一','周二','周三','周四','周五','周六'],  
            dayNamesMin: ['日','一','二','三','四','五','六'],
            onSelect: function (selectedDate) {
                $('#startdate').datepicker('option', 'maxDate', selectedDate);
            }
        });

    };

    pagefunction();
    var img_deg = 0;
    $(".read_imgs_90").click(function () {
        img_deg += 90;
        if(img_deg === 360){
            img_deg = 0
        }
        $(this).next().css({
            transform:'rotate('+img_deg+'deg)'
        });
    })

    </script>